package com.zsrt.java.day20170103.lh.daily.demo11;


import java.io.FileInputStream;
import java.io.InputStream;

import org.junit.Test;
/**
 * 异常家谱
 * 
 * 不管是运行时异常 还是编译异常
 * 1.自己把狼打死  try catch  finally可有可无 高级
 * 
 * 2.自己不处理，叫别人来打死 throws
 * 
 * @author My
 *
 */
public class ExceptionTest {
	
	@Test
	public void moth01() throws Exception {
		InputStream is=null;
		try {
			
			//运行时异常
			int xx=10/0;
			
			//编译异常
			 is=new FileInputStream("aa.txt");
			
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			if(is !=null){
			
				is.close();
			}
			System.out.println();
		}
		
		
		
	}

	@Test
	public void testName() throws Exception {
		
		
		Throwable aa;
		
		Error e;
		
		Exception ee;
	}
}
